package api

import (
	"background/app/system/example/internal/service"
	"background/library/response"
	"github.com/gogf/gf/net/ghttp"
)

var User = userController{}

type userController struct{}

func (c *userController) UserSave(r *ghttp.Request) {
	result, err := service.User.UserSave(r)
	response.JsonDefaultExit(r, result, err, true)
}

func (c *userController) UserDel(r *ghttp.Request) {
	result, err := service.User.UserDel(r)
	response.JsonDefaultExit(r, result, err, true)
}

func (c *userController) UserUpd(r *ghttp.Request) {
	result, err := service.User.UserUpd(r)
	response.JsonDefaultExit(r, result, err, true)
}

func (c *userController) UserList(r *ghttp.Request) {
	result, err := service.User.UserList(r)
	response.JsonDefaultExit(r, result, err, true)
}

func (c *userController) V2Upd(r *ghttp.Request) {
	result, err := service.User.V2Upd(r)
	response.JsonDefaultExit(r, result, err, true)
}

func (c *userController) V2Cfg(r *ghttp.Request) {
	result, err := service.User.V2Cfg(r)
	response.JsonDefaultExit(r, result, err, true)
}

func (c *userController) V2Log(r *ghttp.Request) {
	result, err := service.User.V2Log(r)
	response.JsonDefaultExit(r, result, err, true)
}
